import django_filters
from .models import OncallInfo


class OncallInfoFilter(django_filters.FilterSet):
    dev_group = django_filters.CharFilter(field_name='dev_group', lookup_expr='exact')
    start_time = django_filters.DateFilter(field_name='start_time', lookup_expr='icontains')
    end_time = django_filters.DateFilter(field_name='end_time', lookup_expr='icontains')

    class Meta:
        model = OncallInfo
        # 搜索字段
        fields = ('dev_group', 'start_time', 'end_time')